from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import ExecuteProcess
from launch.substitutions import FindExecutable

def generate_launch_description():
    t1=Node(package="turtlesim",executable="turtlesim_node")
    
    # cmd=ExecuteProcess(
    #     cmd=["ros2 topic echo /turtle1/pose"],
    #     output="both",
    #     shell=True
    # )
    cmd=ExecuteProcess(
        cmd=[FindExecutable(name="ros2"),"topic echo /turtle1/pose"],
        output="both",
        shell=True
    )
    return LaunchDescription([t1,cmd])